@echo off

set starttime=

call :getsectime
set /a starttime=sectime

REM do something here
pause

call :getsectime

set /a diff=sectime-starttime
call :gethrmnsctime %diff%

echo job took %hr% hours, %mn% minutes and %sc% seconds

goto :eof

:getsectime
set hr=%time:~0,2%
set mn=%time:~3,2%
set sc=%time:~6,2%
set /a sectime=hr*3600+mn*60+sc
goto :eof

:gethrmnsctime
set _var=%1
echo %_var%
set /a hr=_var/3600
set /a _var=_var-hr*3600
set /a mn=_var/60
set /a _var=_var-mn*60
set /a sc=_var
goto :eof